import { Driver } from "../db";
let DB = require("../db");

let opt = new Driver();

opt.pagnate("ncghjxx", {}, 0, 1000).then((items: any) => {
    let item: any;
    for (let i = 0, j = items.length; i < j; i++) {
        let item = items[i];
        let size = item["用地面积"];
        if (/(\d+.*?)亩/.test(size)) {
            let sz: number = parseFloat(RegExp.$1);
            sz = sz * 666.67;
            console.log(size + " -> " + sz);
            opt.update("ncghjxx", { title: item.title }, { "用地面积(m2)": sz });
        }
    }
    process.exit(0);
}, (err) => {
    console.error(err);
});